/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hoaptt.pieces;

import com.hoaptt.helper.Coordinate;
import com.hoaptt.model.Board;
import java.util.ArrayList;

/**
 *
 * @author ThuHoa
 */
public abstract class Piece {

    public enum PLAYER {
        A, B
    }
    public enum NAMEPIECE {
        advisor, cannon, chariot, default1, elephant, general, horse, solider
    }
    
    String nameA;
    String nameB;
    public NAMEPIECE alias;
    public PLAYER player;

    public Piece(PLAYER player) {
        this.player = player;
    }

    public String getName() {
        if (player == PLAYER.A) {
            return nameA;
        }
        return nameB;
    }

    public PLAYER getPlayer() {
        return player;
    }

    public void setPlayer(PLAYER player) {
        this.player = player;
    }

    public void setName(String name) {
        if (player == PLAYER.A) {
            nameA = name;
        } else {
            nameB = name;
        }
    }

    public NAMEPIECE getAlias() {
        return alias;
    }

    public void setAlias(NAMEPIECE alias) {
        this.alias = alias;
    }
    
    public abstract ArrayList<Coordinate> generateMove(Board board, Coordinate loc);
    
}
